define(function(require, exports, module) {
    var ALL = require("../../common/all"),
        Dialog = ALL.Dialog,
        CONFIG = ALL.CONFIG,
        METHOD = ALL.METHOD,
        Init = ALL.Init;

    var _Dialog = new Dialog({
        title : "提示",
        content : "<p>是否确定将用户从该藏品主力中移除？</p>",
        text4Btn: ["确定", "取消"],
        class4Btn: ["", "line"]
    });

    var _vm = Init.initVue({
        data : {
            list : [],
            cur : 1,
            all : 0,
            schFlag : false,
            search : {
                col_id: "",
                pnr_no : "",
            }
        },
        methods: {
            reSearch : function() {
                this.schFlag = true;
                this.getData(1);
            },
            reset : function() {
                this.schFlag = false;
                this.search.col_id = "";
                this.search.pnr_no = "";
            },
            getData : function(n) {
                _vm.search.page = n;
                _vm.search.num = 10;
                METHOD.loading.show();
                METHOD.ajax("user/asset/main_account", _vm.search).done(function(json){
                    METHOD.loading.hide();
                    _vm.list = json.data;
                    _vm.all = json.page.pages;
                }).fail(function(){
                    METHOD.loading.hide();
                });
            },
            remove : function(item){
                _Dialog.showUI(function(i) {
                    if (i == 0) {
                        METHOD.loading.show();
                        METHOD.ajax("user/asset/rm_main_force", {id:item.id}, {type:"post"}).done(function(json){
                            METHOD.loading.hide();
                            _vm.getData(_vm.cur);
                        }).fail(function(){
                            METHOD.loading.hide();
                        });
                    }
                    this.hideUI();
                });
            }
        }
    });


    _vm.search.col_id = METHOD.getQueryParms("id") || "";
    _vm.getData(1);

});

